package com.xh.xyzp.common.constant;


import com.xh.xyzp.domain.entity.User;

/**
 * @Author: xianghao
 * @Description:
 * @Date: 2024-10-04  00:09
 */
public class UserContext {

    private static ThreadLocal<User> threadLocal = new ThreadLocal<>();

    public static User getUser(){
        return threadLocal.get();
    }

    public static void setUser(User userDto){
        threadLocal.set(userDto);
    }

    public static void removeUser(){
        threadLocal.remove();
    }

}
